<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="expires" content="0">
    <!-- BEGIN 全局样式 -->
    <link rel="stylesheet" href="../../lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" type="text/css"/>
    <link rel="stylesheet" href="../../css/reset-diy.css" type="text/css">
    <title>查看探霸数据</title>
    <style>
        h4 {
            display: inline-block;
        }

        select {
            display: inline-block !important;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="mt-25">
        <h4 class="pull-left">请选择设备: </h4>
        <div class="col-md-4 col-sm-4">
            <select class="select form-control">
                <option value="102AB37A43D0">102AB37A43D0</option>
                <option value="3408BC10611F">3408BC10611F</option>
                <option value="84BE523D1DEC">84BE523D1DEC</option>
                <option value="8844771A456F">8844771A456F</option>
                <option value="90C7D8B46C02">90C7D8B46C02</option>
            </select>
        </div>
        <div class="col-md-2 col-sm-2">
            <input type="text" class="limit form-control" placeholder="填写条数" value="100">
        </div>
        <span class="btn-get btn btn-primary">获取数据</span>
    </div>
    <div id="main" style="height:400px;"></div>
</div>

<!--核心脚本sss-->
<script src="../../lib/jquery/1.9.1/jquery.js" type="text/javascript" charset="utf-8"></script>
<!--[if lt IE 9]>
<script src="../../js/excanvas.min.js"></script>
<script src="../../js/respond.min.js"></script>
<![endif]-->
<!--加密插件sss 必须放在jquery.myPlugIn_v1.0.js前面-->
<script src="../../js/common/jsrsasign-all-min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/common/crypto-js.min.js" type="text/javascript" charset="utf-8"></script>
<!--加密插件eee-->

<!--<script src="../../../js/bootstrap.min.js" type="text/javascript"></script>-->
<script src="../../lib/layer/2.4/layer.js" type="text/javascript" charset="utf-8"></script>
<script src="../../lib/echarts/echarts.js"></script>
<!--<script src="../../../lib/laypage/1.2/laypage.js" type="text/javascript" charset="utf-8"></script>-->
<script src="../../js/work-box.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/common/jquery.myPlugIn_v1.0.js" type="text/javascript" charset="utf-8"></script>

<script>
    var T = new Extend_base();
    jQuery(document).ready(function () {
        function Show() {
            this.ClickEvent();
        }

        Show.prototype = {
            ClickEvent: function () {
                var _this = this;
                this.mac = T.getSession('tbMac');
                $('.tb').text(this.mac);

                $('.btn-get').on('click', function () {
                    var val = $('.select').val();
                    var limit = $('.limit').val();

                    T.ajaxSecret(url_join('admin/draw'), 'post', {
                            tb: _this.mac,
                            mac: val,
                            limit: limit
                        }, function (res) {
                            var option = {
                                xAxis: {
                                    type: 'category',
                                    data: res.data.created_at
                                },
                                yAxis: {
                                    type: 'value'
                                },
                                series: [{
                                    data: res.data.rssi,
                                    type: 'line'
                                }]
                            };
                            var myChart = echarts.init(document.getElementById('main'));
                            myChart.setOption(option);
                        }
                    );
                });

                /*
                <div id="main" style="width: 600px;height:400px;"></div>

                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('main'));

                // 指定图表的配置项和数据
                var option = {
                    title: {
                        text: 'ECharts 入门示例'
                    },
                    tooltip: {},
                    legend: {
                        data:['销量']
                    },
                    xAxis: {
                        data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
                    },
                    yAxis: {},
                    series: [{
                        name: '销量',
                        type: 'bar',
                        data: [5, 20, 36, 10, 10, 20]
                    }]
                };

                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
                */
            },
        };
        new Show();
    });
</script>
</body>
</html>